import React from 'react'
import { HashRouter as Router, Route, Link, Switch } from 'react-router-dom'
import Main from './Main'
import About from './About'
import Info from './Info'
import Topic from './Topic'
import Home from './Home'
import NoMatch from './NoMatch'

export default class IRoute extends React.Component {
  render() {
    return (
      <Router>
        <Home>
          <Switch>
            <Route  path="/main" render={()=>
              <Main>
                {/* <Route path="/main/a" compoennt={About}></Route> */}
                <Route path="/main/:mainId" compoennt={Info}></Route>
              </Main>
            }></Route>
            <Route path="/about" component={About}></Route>
            <Route path="/topics" component={Topic}></Route>
            <Route component={NoMatch}></Route>
          </Switch>
        </Home>
      </Router>
    );
  }
}